package com.union.official.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.union.official.common.entity.PageVO;
import com.union.official.common.util.EntityUtil;
import com.union.official.common.util.PageVoUtils;
import com.union.official.entity.model.CityDO;
import com.union.official.entity.vo.request.CityReqVO;
import com.union.official.entity.vo.request.CityRespVO;
import com.union.official.common.entity.ResultVO;
import com.union.official.dao.CityDao;
import com.union.official.service.WebService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 类的功能描述
 *
 * @author 杨 强
 * @package com.union.official.service.impl
 * @createTime 2024-03-06 17:12
 */
@Slf4j
@Service
public class WbeServiceImpl implements WebService {

    @Resource
    private CityDao cityService;

    @Override
    public PageVO<CityRespVO> hello(CityReqVO reqVO) {
        IPage<CityDO> page = cityService.hello(reqVO);
        List<CityRespVO> list = EntityUtil.toToVo(page.getRecords(), CityRespVO.class);
        return PageVoUtils.toPageVO(page, list, reqVO);
    }
}
